package com.example.backdemo.controller;

import com.example.backdemo.pojo.Aum;
import com.example.backdemo.pojo.Message;
import com.example.backdemo.service.ActionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class ActionController {
    @Autowired
    private ActionService actionService;

    @GetMapping("/getAumAvg")
    public List<Aum> getAumAvg() {
        return actionService.getAumAvg();
    }


    @GetMapping("/getLabel")
    public Map<String, Integer> getLabel() {
        return actionService.getLabel();
    }


    @GetMapping("/getMessage")
    public List<Message> getMessage() {
        return actionService.getMessage();
    }

    @GetMapping("/getIOsum")
    public Map<String, Integer> getIOsum() {
        return actionService.getIOsum();
    }

    @GetMapping("/getIOmoneyMax")
    public Map<String,Float> getIOmoneyMax() {
        return actionService.getIOmoneyMax();
    }

    @GetMapping("/getIOmoneyAvg")
    public Map<String,Float> getIOmoneyAvg() {
        return actionService.getIOmoneyAvg();
    }

}
